{{include template('header','member')}}
<script type="text/javascript" src="{{STATIC_URL}}/plugins/address.js"></script>
<div class="w980 main">
    {{include template('left','member')}}
    <div class="main_right">
        <div class="tit"><h3>积分充值</h3></div>
        <div class="main_cont">
            <form method="post" action="http://localhost:88/member/member_pay/create_order.html" onsubmit="return chcekall()" target="_blank">
                <table>
                    <tr><td>剩余积分：</td><td><span class="red point">2</span></td></tr>
                    <tr><td>充值金额：</td><td><input type="money" name="money" required value="30" class="form-control" style="width:150px;float: left;"> 元 <span class="red">1元人民币可充值 10 点积分</span></td></tr>
                    <tr><td>支付方式：</td>
                        <td>
                            {{foreach $pay_mode as $key=>$val}}
                            <label class="label_img">
                                <input type="radio" name="paytype" value="{{$val.id}}"  {{if $key==0}} checked{{/if}}/>
                                       <img src="/static/admin/pay/{{$val.logo}}" alt="{{$val.name}}" title="{{$val.name}}" />
                            </label>
                            {{/foreach}}
                        </td>
                    </tr>
                    <tr><td>验证码：</td><td>
                            <input type="text" name="code" class="form-control verify_input" value="{{$code}}"
                                   datatype="*4-4" nullmsg="请填写验证码" errormsg="请填写4位验证码"  placeholder="请填写4位验证码" style="width:150px;float: left;"/>
                            <img src="/admin/login/code" border="0" class="verifyimg" onclick="this.src = this.src + '?'" alt="验证码" style="height:33px;cursor:pointer"/>
                        </td></tr>
                    <tr><td></td><td><input type="submit" name="dosubmit" class="submit" value="确认支付"></td></tr>
                </table>
                <script>
                    function chcekall() {
                        if ($("input[name='money']").val() == '' || isNaN($("input[name='money']").val())) {
                            layer.alert('充值金额只能为数字！');
                            return false;
                        }

                        if ($("input[name='code']").val() == '') {
                            layer.alert('验证码不能为空！');
                            return false;
                        }

                        if ($('input:radio[name="paytype"]:checked').val() == null) {
                            layer.alert('请选择支付方式！');
                            return false;
                        }

                        return true;
                    }
                </script>
            </form>
        </div>
    </div>
</div>

{{include template('footer','member')}}
